package com.sdy.interceptor;

import com.sdy.util.Contact;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 用于加载完成之后清除contactCompany
 */
public class ToPageInterceptor implements HandlerInterceptor {

    @Override
    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
        System.out.println("清除contactCompany");
        System.out.println(request.getRequestURI());
        request.getSession().removeAttribute(Contact.COMPANY_KET);
    }
}
